Method of color compression

ABSTRACT

A color is encoded by defining the color as a triplet of Cartesian color space (e.g., RGB) (FIG.  1 ) coordinate values and transforming the triplet to spherical coordinates (FIG.  1 ) to give a transformed triplet of spherical coordinate values (FIG.  1 ). An image that includes a plurality of image pixels with Cartesian color space coordinate values is compressed by transforming to spherical coordinates, spatially downsampling with respect to one or more of the spherical coordinates and truncating the wordlengths of all the values of one or more of the spherical coordinates. A color image compression device includes a processor for so transforming and downsampling input image pixels.

FIELD AND BACKGROUND OF THE INVENTION

The present invention relates to the digital representation of colorand, more particularly, to a method of compressing color images.

A digital color image is an array of pixels. With each pixel isassociated a numerical representation of that pixel's color in a colorspace. For example, the most common color space for displaying colorimages on a video monitor is the RGB (Red, Blue, Green) color space.This color space has three coordinates, R, G and B. The color of a pixelis represented as a triplet of three numbers: the value of the Rcoordinate, the value of the G coordinate and the value of the Bcoordinate. Typically, each of the three coordinate values isrepresented as an eight-bit word, for a total of 24 bits per pixel. Thisallows the display of 256³=16,777,216 distinct colors, commonly referredto as “True Color”.

To reduce the digital volume needed to store or transmit an RGB image,the image is compressed. The conventional compression method is totransform the RGB coordinates to a different color space, theLuminance/Chrominance (YUV) color space, and to spatially downsample theresulting transformed value to give a spatially resampled image thatemphasizes the Y coordinate (brightness or luminance) at the expense ofthe U and V coordinates (chrominance coordinates), to take advantage ofthe fact that the human eye is more sensitive to spatial changes inbrightness than to changes in color. Typically, the spatial downsamplingis effected by merging pairs of pixels with respect to the chrominancecoordinates. FIG. 4 illustrates one way of doing this spatialdownsampling: “4:2:2 downsampling”. At the top of FIG. 4 are fouradjacent image pixels 20, 22, 24 and 26, each with its respective valuesof the R, G and B coordinates. The transformation to YUV coordinatesgives, for each image pixel, respective values of the Y, U and Vcoordinates. Then, pixels 20 and 22 are merged with respect to theirchrominance coordinates into a single downsampled pixel 28, and pixels24 and 26 are merged with respect to their chrominance coordinates togive a single downsampled pixel 30. In this specific example, this isdone by dropping the chrominance coordinate values of image pixels 22and 26 in favor of the chrominance coordinate values of image pixels 20and 24; but it also could be done by averaging the chrominancecoordinates of image pixels 20 and 22 and by averaging the chrominancecoordinates of image pixels 24 and 26. The net result is to replace, foreach group of four image pixels, 96 bits with 64 bits, i.e., 16 bits perimage pixel. Unfortunately, this spatial downsampling also visiblydegrades the quality of the resulting image.

There is thus a widely recognized need for, and it would be highlyadvantageous to have, a method of downsampling a digital image, e.g.from 24 bits per pixel to 8 bits per pixel, with no appreciable loss inimage quality.

SUMMARY OF THE INVENTION

According to the present invention there is provided a method ofencoding a color, including the steps of: (a) defining the color as atriplet of Cartesian color space coordinate values; and (b) transformingthe triplet to spherical coordinates.

According to the present invention there is provided a method ofcompressing an image that includes a plurality of image pixels, eachimage pixel including a respective triplet, of Cartesian color spacecoordinate values, all the coordinate values having a common color spacecoordinate wordlength, the method including the steps of: (a)transforming the each triplet to spherical coordinates, therebyproviding a respective transformed triplet of spherical coordinatevalues; and (b) spatially downsampling the image pixels with respect toat least one of the spherical coordinates; thereby producing, for eachat least one spherical coordinate, a plurality of downsampled pixels.

According to the present invention there is provided a color imagecompression device, for compressing an image that includes a pluralityof image pixels, each image pixel including a respective triplet, ofCartesian color space coordinate values, that has a color spacecoordinate wordlength, the device including: (a) a processor for: (i)transforming each triplet to spherical coordinates, thereby providing arespective transformed triplet of spherical coordinate values, andspatially downsampling the image pixels with respect to at least one ofthe spherical coordinates, thereby producing, for each at least onespherical coordinate, a plurality of downsampled pixels.

One aspect of the present invention is a method of encoding a color bydefining the color as a triplet of Cartesian color space coordinatevalues and transforming the triplet to spherical coordinates, therebyproducing a transformed triplet of spherical coordinate values.Preferably, the color space is an RGB color space and the azimuthcoordinate of the spherical coordinates is in either the RG plane of theRGB space or in the RB plane of the RGB space or in the GB plane of theRGB space.

Preferably, the triplet, as initially defined, has a certain color spacecoordinate wordlength, and the method also includes the step oftruncating the wordlength of at least one of the spherical coordinatevalues to a lower wordlength than the original color space wordlength.

Another aspect of the present invention is a method of compressing animage. The image includes a plurality of image pixels. Each image pixelincludes a respective triplet of Cartesian color space coordinatevalues, all of which have a common color space coordinate wordlength. Asin the first aspect of the present invention, each triplet istransformed to spherical coordinates, thereby producing, for eachtriplet, a transformed triplet of spherical coordinate values. Then theimage pixels are spatially downsampled with respect to one or more ofthe spherical coordinates, thereby producing a plurality of downsampledpixels for the targeted spherical coordinate(s).

Preferably, the downsampling is done with respect to the angularspherical coordinates, i.e., the azimuth coordinate and the elevationcoordinate.

Preferably, the wordlengths of the coordinate values of one or more ofthe spherical coordinates are truncated to a lower wordlength than thecolor space coordinate wordlength. Preferably, the combination ofdownsampling and truncation produces an average number of bits per imagepixel that is less than twice the color space coordinate wordlength.Most preferably, the combination of downsampling and truncation producesan average number of bits per image pixel that is at most the colorspace coordinate wordlength.

A color image compression device of the present invention includes aprocessor for implementing the second aspect of the present invention.Preferably, the device also includes a medium for storing thedownsampled pixels and/or a transmitter for transmitting the downsampledpixels.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention is herein described, by way of example only, withreference to the accompanying drawings, wherein:

FIG. 1 illustrates the transformation of RGB coordinates to Yαβcoordinates according to the present invention;

FIGS. 2 and 3 are high-level block diagrams of image compression devicesof the present invention;

FIG. 4 illustrates 4:2:2 spatial downsampling in the context of theprior art;

FIG. 5 illustrates 4:1:1 spatial downsampling in the context of thepresent invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention is of a method of compressing digital images.Specifically, the present invention can be used to compress an RGB image3:1 with no appreciable loss in image quality.

The principles and operation of image compression according to thepresent invention may be better understood with reference to thedrawings and the accompanying description.

Referring now to the drawings, FIG. 1 illustrates the Yap coordinatesystem of the present invention. Yαβ is a new color space that bears thesame relationship to the RGB color space as spherical coordinates bearto Cartesian coordinates. Y is the radial coordinate (Y=√{square rootover (R²+G²+B²)}), α is the elevation coordinate and β is the azimuthcoordinate. As defined in FIG. 1, β is in the RB plane. In alternateembodiments of the present invention, β is in the RG plane or in the GBplane. Y is luminance, as in the YUV color space; but the new colorcoordinates α and β do not bear a direct relationship to the U and Vcoordinates of the YUV color space. Given a triplet of RGB coordinatevalues, the corresponding values of the Y, α and β coordinates togetherconstitute a transformed triplet of spherical coordinate values.

I have found that transforming an image of RGB pixels to Yαβ space,downsampling the resulting Yαβ coordinate values with respect to α and βand further truncating the wordlengths of the Y coordinate values and ofthe downsampled α and β coordinate values provides a compressed imagethat has almost the same visual quality as the original RGB image butthat has only one-third as many bits as the original image.Specifically, starting with a conventional 24-bit (True Color) RGBimage, the RGB coordinates of the image pixels are transformed to Yαβcoordinates and downsampled 4:1:1, as illustrated in FIG. 5. Then thewordlengths of the Y-coordinate values are truncated from eight bits tofive bits and the wordlengths of the downsampled α and β coordinatevalues are truncated from eight bits to six bits. The overallcompression is from 24 bits (three times the True Color RGB wordlength)per image pixel to 8 bits (equal to the True Color RGB wordlength) perpixel.

FIG. 5 shows all four image pixels 20, 22, 24 and 26 being merged withrespect to their angular coordinates to give a single downsampled pixel32 that retains only the angular coordinate values of image pixel 20.Alternatively, the angular coordinates of image pixel 20 could be theangular coordinates of any of the other image pixels 22, 24 or 26, or anaverage of all four sets of angular coordinates.

Although the primary intended application of the present invention is tothe compression of RGB images, the principles of the present inventionare applicable to images whose pixels are encoded using other colorspaces, for example the HSL (Hue, Saturation, Luminance) color space.

FIG. 2 is a high-level block diagram of an image compression device 10of the present invention. Device 10 includes a processor 12 and adigital storage medium 14 such as a digital video tape or a nonvolatilememory (e.g. a compact disk or a flash disk). Processor 12 receives astream of digital RGB video images from a vide camera 16, compresses theimages using the method of the present invention, and stores thecompressed images, as one truncated-wordlength value of Y per originalimage pixel and one truncated-wordlength value of each angularcoordinate α and β per downsampled pixel, on medium 14.

FIG. 3 is a high-level block diagram of another image compression device10′ of the present invention. Device 10′ includes processor 12 and, inplace of medium 14, a transmitter 18. Processor 12 receives a stream ofdigital RGB video data from video camera 16, compresses the images usingthe method of the present invention, and uses transmitter 18 to transmitthe compressed images, as one truncated-wordlength value of Y peroriginal image pixel and one truncated-wordlength value of each angularcoordinate α and β per downsampled pixel, to a remote receiver.

In one preferred embodiment of the present invention, processor 12 is anappropriately programmed general-purpose processor. In an alternatepreferred embodiment of the present invention, processor 12 is aspecial-purpose processor that uses dedicated hardware to implement themethod of the present invention.

While the invention has been described with respect to a limited numberof embodiments, it will be appreciated that many variations,modifications and other applications of the invention may be made.

1. A method of encoding a color, comprising the steps of: (a) definingthe color as a triplet of Cartesian color space coordinate values; and(b) transforming said triplet to spherical coordinates.
 2. The method ofclaim 1, wherein said color space is an RGB color space.
 3. The methodof claim 2, wherein said spherical coordinates include an azimuthcoordinate in an RG plane.
 4. The method of claim 2, wherein saidspherical coordinates include an azimuth coordinate in an RB plane. 5.The method of claim 2, wherein said spherical coordinates include anazimuth coordinate in a GB plane.
 6. The method of claim 1, wherein saidtriplet has a color space coordinate wordlength, and wherein saidtransforming produces a transformed triplet of spherical coordinatevalues, the method further comprising the step of: (c) truncating awordlength of at least one of said spherical coordinate values to at alower wordlength than said color space coordinate wordlength.
 7. Amethod of compressing an image that includes a plurality of imagepixels, each image pixel including a respective triplet, of Cartesiancolor space coordinate values, all said coordinate values having acommon color space coordinate wordlength, the method comprising thesteps of: (a) transforming said each triplet to spherical coordinates,thereby providing a respective transformed triplet of sphericalcoordinate values; and (b) spatially downsampling said image pixels withrespect to at least one of said spherical coordinates; therebyproducing, for each said at least one spherical coordinate, a pluralityof downsampled pixels.
 8. The method of claim 7, wherein said colorspace is an RGB color space.
 9. The method of claim 8, wherein saidspherical coordinates include an azimuth coordinate in an RG plane. 10.The method of claim 8, wherein said spherical coordinates include anazimuth coordinate in an RB plane.
 11. The method of claim 8, whereinsaid spherical coordinates include an azimuth coordinate in a GB plane.12. The method of claim 7, wherein said spherical coordinates include anazimuth coordinate and an elevation coordinate, and wherein said spatialdownsampling is effected with respect to both said azimuth coordinateand said elevation coordinate.
 13. The method of claim 8, furthercomprising the step of: (c) for at least one of said sphericalcoordinates, truncating a wordlength of said spherical coordinate valuesto a lower wordlength than said color space coordinate wordlength. 14.The method of claim 12, wherein said spatial downsampling and saidtruncating together produce an average number of bits per input pixelthat is less than twice the color space coordinate wordlength.
 15. Themethod of claim 14, wherein said average number of bits per input pixelis at most the color space coordinate wordlength.
 16. A color imagecompression device, for compressing an image that includes a pluralityof image pixels, each image pixel including a respective triplet, ofCartesian color space coordinate values, that has a color spacecoordinate wordlength, the device comprising: (a) a processor for: (i)transforming each triplet to spherical coordinates, thereby providing arespective transformed triplet of spherical coordinate values, and (ii)spatially downsampling said image pixels with respect to at least one ofsaid spherical coordinates, thereby producing, for each said at leastone spherical coordinate, a plurality of downsampled pixels.
 17. Thedevice of claim 16, further comprising: (b) a medium for storing saiddownsampled pixels.
 18. The device of claim 8, further comprising: (b) atransmitter for transmitting said downsampled pixels.
 19. The device ofclaim 16, wherein, for at least one of said spherical coordinates, saidprocessor also truncates a wordlength of said spherical coordinatevalues to a lower wordlength than said color space coordinatewordlength.